
module Table where

import Data.Int

data BaseColumn t = BaseColumn {
	columnIndex :: Int,
	columnName :: String
}

type ByteColumn = BaseColumn Int8
type ShortColumn = BaseColumn Int16
type IntColumn = BaseColumn Int32
type LongColumn = BaseColumn Int64
type FloatColumn = BaseColumn Float
type DoubleColumn = BaseColumn Double

data Column = ByteColumn
	| ShortColumn
	| IntColumn
	| LongColumn
	| FloatColumn
	| DoubleColumn

data Value = ByteValue Int8 
	| ShortValue Int16
	| IntValue Int32
	| LongValue Int64
	| FloatValue Float
	| DoubleValue Double
	deriving (Show,Read)

data Row = Row [Maybe Value]

class Table t where
	columns :: t -> [Column]
	rows :: t -> IO [Row]
 	count :: t -> Maybe Integer
 	
